package com.lizardmind.haofudoctor.ui.diagnosis.sickMan.advisory.commonWords

import android.os.Bundle
import android.view.View
import com.linxiao.framework.activity.BaseActivity
import com.linxiao.framework.util.color
import com.linxiao.framework.util.getBaseFragmentStatePagerAdapter
import com.linxiao.framework.util.getDataBinding
import com.linxiao.framework.widget.NavigationView
import com.lizardmind.haofudoctor.R
import com.lizardmind.haofudoctor.databinding.ActivityCommonWordsBinding
import kotlinx.android.synthetic.main.activity_common_words.*
import kotlinx.android.synthetic.main.include_title_text.*

class CommonWordsActivity : BaseActivity() {

    val listFragment= arrayListOf(SuggestFragment(),
            QustionFragment(),
            MedicineExpressFragment()
            )

    val binding by lazy { getDataBinding<ActivityCommonWordsBinding>(R.layout.activity_common_words) }
    override fun onCreatRootView(): View? {
        return binding.root
    }

    override fun onInitView(savedInstanceState: Bundle?) {
        VPager_CommonWords.setScanScroll(false)
        VPager_CommonWords.adapter= getBaseFragmentStatePagerAdapter(supportFragmentManager,listFragment)
        naView_CommonWords.binding(VPager_CommonWords)
                .setTextViewChildTextFromString(resources.getStringArray(R.array.common_words))
                .setUnSelectTextColor(color(R.color.gray3))
                .setSelectTextColor(color(R.color.notice_red))
                .setTextSize(16f)//文字大小，单位为sp，默认为42px
                .setSlidingStripPosition(NavigationView.BOTTOM)
                .setScllorHeight(2f)
                .setScllorColor(color(R.color.notice_red))
                .commit()//提交，执行修改

        titleText.text="常用语"

        imgLeft.setImageResource(R.mipmap.back)
        imgLeft.setOnClickListener {
            finish()
        }
    }

}
